home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Ham Radio 2000
/
Ham Radio 2000.iso
/
ham2000
/
morse
/
bunn41ta
/
n4lta.lst
< prev
next >
Wrap
File List
|
1994-09-02
|
9KB
|
176 lines
===== Parallax PIC16C5x Assembler v2.1 =====
1
2 ;This is a very simple program
3 ;to transmit a morse code
4 ;message with a PIC 16C54
5 ;microcontroller. The morse
6 ;message is constructed by
7 ;calling subroutines that
8 ;sends dits,dahs, and spaces
9 ;
10
11
12
13 ;START OF PROGRAM
14
15 ;Set the device type,osc type,WDT status
16 ;and code protect status
17
18
19 000- DEVICE PIC16C54,rc_OSC,WDT_OFF,PROTECT_OFF
20
21
22 1FF- A00 RESET start ;vector to
23 ;here on
24 ;reset
25
26 =0010 Count0 equ 10h
27 =0011 Count1 equ 11h ;CW Speed
28 ;timing bytes
29 ;labels
30
31
32 000- C80 005 Start mov !RA,#10000000b ;set bit7
33 ;as an input
34 ;bit for
35 ;future use
36
37 002- 92B call WDSPC ;wait 1 word
38 ;space and
39 003- 93A CALL DAH ;then send
40 ;the message
41 004- 933 CALL DIT ;by calling
42 ;the appropriate
43 005- 933 CALL DIT ;dits and
44 006- 927 CALL LETSPC ;dahs. The dits
45 ;and dahs have
46 007- 933 CALL DIT ;have spacing
47 ;built in
48
49 008- 92B CALL WDSPC ;DE
50
51 009- 93A CALL DAH
52
53 00A- 933 CALL DIT
54 00B- 927 CALL LETSPC ;N
55
56 00C- 933 CALL DIT
57 00D- 93A CALL Dah
58 00E- 93A CALL Dah
59 00F- 93A CALL Dah
60 010- 93A CALL DAH
61 011- 927 CALL LETSPC ;1
62
63 012- 933 CALL DIT
64 013- 933 CALL Dit
65 014- 93A CALL Dah
66 015- 933 CALL DIT
67 016- 927 CALL LETSPC ;F
68
69
70 017- 93A CALL DAH
71 018- 933 call dit
72 019- 933 call dit
73 01A- 933 call dit
74 01B- 927 CALL LETSPC ;B
75
76 01C- 92B CALL WDSPC
77 01D- 92B CALL WDSPC
78 01E- 92B CALL WDSPC ;WAIT
79 ;for 3
80 ;word spaces
81 ;and jump
82 01F- A00 jmp start ;to the
83 ;beginning
84 ;to repeat
85 ;the message
86
87 ;DITIME is a routine that
88 ;generates a one dit timing
89 ;delay
90
91
92
93 020- DITIME
94 020- C20 031 mov Count1,#00100000b
95 022- 2F0 A22 :Loop djnz Count0,:Loop
96 024- 2F1 A22 djnz Count1,:Loop
97 026- 800 ret
98
99 ;LETSPC generates a letter space
100 ;delay
101
102
103 027- 920 LETSPC call DITIME
104 028- 920 call DITIME
105 029- 920 call DITIME ;wait 3 ditimes
106 02A- 800 ret
107
108 ;WDSPC generates a word space
109 ;delay
110
111 02B- 920 WDSPC call DITIME
112 02C- 920 call DITIME
113 02D- 920 call DITIME
114 02E- 920 call DITIME
115 02F- 920 call DITIME
116 030- 920 call DITIME
117 031- 920 call DITIME ;wait 7 ditimes
118 032- 800 ret
119
120 ;DIT sends a dit and waits 1
121 ;morse space
122
123 033- C03 125 DIT or RA,#00000011b ;set bit0 and bit1
124 ;on
125 035- 920 call DITIME
126
127 036- C00 165 and RA,#00000000b ;turn them off
128
129 038- 920 call DITIME ;wait 1 ditime
130 039- 800 ret
131
132
133 ;DAH sends a dah and waits one
134 ;morse space
135
136
137 03A- C03 125 DAH or RA,#00000011b ;Bits 1,0 on
138 03C- 920 call DITIME
139 03D- 920 call DITIME
140 03E- 920 call DITIME ;wait 3 dits
141 03F- C00 165 and RA,#00000000b ;turn off
142
143 041- 920 call DITIME ;wait 1 ditime
144 042- 800 ret
145
146
147
148
149 ;End of the program
150 ;written by P Bunn, N4LTA
151 ;
===== Errors: 0 =====